﻿using System;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.SessionState;
using System.Security;
using System.Security.Permissions;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ACM.cmsarea08.DBManager;
using ACM.cmsarea08;
using ACM.cmsarea08.mainconfiguration;
using System.Xml;


namespace ACM.cmsarea08.Administration.Controls 
{
	/// <summary>
	/// Description of WebControl1
	/// </summary>
	public class UserLogo : UserControl
	{	
		const string providerName = "Itan_MembershipProvider";
		//protected Login login_manager001;
		private string _admlogo = "";
		protected System.Resources.ResourceManager rm;
		protected string admlogo{
			get {
				if(Cache["admlog"]==null)
					return _admlogo;
				else
					return Cache["admlog"].ToString();
			}
			set {
				_admlogo = value;
				Cache["admlog"]=value;
			}
		}
			
			
		override protected void OnInit(EventArgs e)
		{
			//HttpContext.Current.Response.Write("nome: " + Name);
			
			base.OnInit(e);
			if(Application["RM_ADM"]!=null)
    			rm = (System.Resources.ResourceManager) Application["RM_ADM"];
			if(admlogo.Trim()==""){
				ACM.cmsarea08.Administration.Core.DBClass dclass = new ACM.cmsarea08.Administration.Core.DBClass();
				object obj =dclass.ExecuteScalarObj("select admlogo from "+dclass.TablePrefix+"mainconf " +
				                               "where nomeapplicazione='" + mainconfiguration.MainConf.NomeApplicazione + "' limit 1;");
				if(obj!=null)
					admlogo=obj.ToString();
			}
			InitializeComponent();
		
		}
		
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.OnLoad);
		}
		
		
		private void OnLoad(object sender, EventArgs e)
		{
			
		}

	}
}
